#ifndef  _PAGE_DB_H
#define  _PAGE_DB_H

#include <string>
#include <iostream>

namespace jsearch
{
	/**
	 * class page_db
	 * main data structure to save the page(document) ,doc_id and 
	 * type info 
	 */

	class page_db
	{
		public:
			page_db( std::string scan_dir, std::string file);

			//for indexer
			bool create_db();
			bool persist();
			bool restore();

			// db interface for user
			std::string getnamebyid(int id);
			int getidbyname(const std::string path);

			bool empty() const;
			int size() const;

			void print_db(std::ostream& os = std::cout) const;

		private:
			struct Impl;
			std::tr1::shared_ptr<Impl> pimpl;

	};

}//namespace jsearch

#endif
